<?php

namespace App\Server\Wxapp;

class OpenId
{
    public function get()
    {
        $url = "https://api.weixin.qq.com/sns/jscode2session";
        $params = [
            'appid' => env("Wxapp_appid"),
            'secret' => env("Wxapp_secret"),
            'js_code' => Request()->code,
            'grant_type' => 'authorization_code',
        ];
        $request = new \App\Server\Request\WxRequest;      
        return $request->fetchApi($url, $params);
    }

}